// Only modify this file to include
// - function definitions (prototypes)
// - include files
// - extern variable definitions
// In the appropriate section

#ifndef LibMorse_H_
#define LibMorse_H_
#include "Arduino.h"


#ifdef __cplusplus
	extern "C" {
#endif


class Morse
{
public:
	Morse(int pin);

	void dot();
	void dash();
	void letter_break();
	void word_break();
	void SOS();

	enum SYMBOL
	{
		DOT = 0,
		DASH = 1,
		LETTER_BREAK,
		WORD_BREAK,
		EOC
	};

	//bool send(SYMBOL* code);
	bool send(const SYMBOL* code);

	//bool send(char* str);
	bool send(const char * str);

	bool send(const SYMBOL* code, int len);

	static void LinkedListTest();

protected:
	int _pin;

	static const int _DOT_DELAY = 250;
	static const int _DASH_DELAY = 3*_DOT_DELAY;
	static const int _SYMBOL_DELAY = _DOT_DELAY;
	static const int _LETTER_DELAY = 3*_DOT_DELAY;
	static const int _WORD_DELAY = 7*_DOT_DELAY;

	Morse()	{ /* disallow */ }

	void send_symbol(const SYMBOL symbol);
	void send_symbol(const SYMBOL symbol, const SYMBOL next);
	//const SYMBOL* transcode(const char c, const char n);
};


#ifdef __cplusplus
} // extern "C"
#endif


//Do not add code below this line
#endif /* LibMorse_H_ */
